package model;

import java.util.ArrayList;
import java.util.Arrays;

public class Plane {
    private String  number;
    private String setupTime;
    private String landTine;
    private String[] meal = new String[4];
    private String setupTerminal;
    private String landTerminal;
    private final ArrayList<String> passenger = new ArrayList<>();

    public Plane(){}

    public Plane(String number, String setupTime, String landTine, String setupTerminal, String landTerminal,String[] meal) {
        this.number = number;
        this.setupTime = setupTime;
        this.landTine = landTine;
        this.meal = meal;
        this.setupTerminal = setupTerminal;
        this.landTerminal = landTerminal;
    }

    public void addPassenger(String passengerName){
        passenger.add(passengerName);
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public void setSetupTime(String setupTime) {
        this.setupTime = setupTime;
    }

    public void setLandTine(String landTine) {
        this.landTine = landTine;
    }

    public void setMeal(int position,String meal) {
        this.meal[position] = meal;
    }

    public void setSetupTerminal(String setupTerminal) {
        this.setupTerminal = setupTerminal;
    }

    public void setLandTerminal(String landTerminal) {
        this.landTerminal = landTerminal;
    }

    public String getNumber() {
        return number;
    }

    public String getSetupTime() {
        return setupTime;
    }

    public String getLandTine() {
        return landTine;
    }

    public String[] getMeal() {
        return meal;
    }

    public String getSetupTerminal() {
        return setupTerminal;
    }

    public String getLandTerminal() {
        return landTerminal;
    }

    @Override
    public String toString() {
        return "Plane{" +
                "number='" + number + '\'' +
                ", setupTime='" + setupTime + '\'' +
                ", landTine='" + landTine + '\'' +
                ", meal=" + Arrays.toString(meal) +
                ", setupTerminal='" + setupTerminal + '\'' +
                ", landTerminal='" + landTerminal + '\'' +
                '}';
    }
}
